package com.example.demo.mapper;

import com.example.demo.dto.Carousel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CarouselMapper {

    // 查找所有轮播图
    @Results({
            @Result(column = "image_url",property = "imageUrl"),
            @Result(column = "link_url",property = "linkUrl"),
            @Result(column = "create_time",property = "createTime"),
            @Result(column = "update_time",property = "updateTime"),
    })
    @Select("SELECT id,title,image_url,link_url,status,sort,create_time,update_time from carousel")
    List<Carousel> findAllCarousel();
}
